package com.njwd.rpc.consumer;

import java.math.BigDecimal;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import com.njwd.rpc.api.UserService;
import com.njwd.rpc.api.UserSimpleSerivices;
import com.njwd.rpc.vo.User;

public class DubboInvokeInner {

	
	
	public static void main(String[] args) {
		System.setProperty("dubbo.application.logger","slf4j");
		ClassPathXmlApplicationContext  ctx= new ClassPathXmlApplicationContext(  
	            new String[] {"spring/applicationContext.xml"});  
		ctx.start();
		//---queryUser  查询建议用Get请求----
		UserSimpleSerivices us=(UserSimpleSerivices)	ctx.getBean("userSimpleServices");
		System.out.println("------------start:-queryuser--------------");
		System.out.println(us.queryUserByClassId("pos1","10"));
		System.out.println(us.queryUserByClassId("pos2","10"));
		System.out.println("------------end:-queryuser--------------");
		
		
//		System.out.println("------------start:-registerUser--------------");
//		System.out.println(us.registerUser(new User(new BigDecimal(100),"123" ,"23434")));
//		System.out.println("------------end:-registerUser--------------");
//		
//		
//		
//		System.out.println("------------start:-queryUserMultiParam--------------");
//		System.out.println(us.queryUserMultiParam("123"	,10l));
//		System.out.println("------------end:-queryUserMultiParam--------------");
	}
}
